package com.yxr.affairs;

import android.app.Activity;
import android.content.Intent;
import android.view.KeyEvent;

import com.umeng.analytics.MobclickAgent;
import com.yxr.affairs.api.model.ResultEntity;
import com.yxr.affairs.api.model.child.Login;
import com.yxr.affairs.base.BaseSwipeBackActivity;

public class InvestmentActivity extends BaseSwipeBackActivity {

    public static void startActivity(Activity activity, String borrow_nid){
        Intent intent = new Intent(activity.getApplicationContext(), InvestmentActivity.class);
        intent.putExtra("NID", borrow_nid);
        activity.startActivity(intent);
        activity.overridePendingTransition(R.anim.slide_right_entry, R.anim.hold);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_investment;
    }

    @Override
    protected void initViews() {

    }

    @Override
    protected void updateViews(boolean isRefresh) {

    }



    @Override
    protected void onError_(Throwable e) {

    }

    @Override
    protected void onCancel_() {

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (KeyEvent.KEYCODE_BACK == keyCode) {
            _exit();
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public void onBackPressed() {
        return;
    }

    private void _exit() {
        finish();
    }

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(R.anim.hold, R.anim.slide_right_exit);
    }

    public void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);
    }

    public void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }
}